import request from '@/utils/request'

 //API常量
 const APIS = {
  V1: "/v1"
}

export function listDict(params) {
  return request({
    url: APIS.V1+`/system/account/dict/list`,
    method: 'get',
    params:params
  })
}

export function listProjectProjectDict(params) {
  return request({
    url: APIS.V1+`/system/account/dict/listProjectProjectDict`,
    method: 'get',
    params:params
  })
}

export function getDict(name) {
  return request({
    url: APIS.V1 + `/system/dict/${name}`,
    method: 'get'
  })
}


export function listDictPage(params) {
  return request({
    url: APIS.V1+`/system/account/dict/page/list`,
    method: 'get',
    params:params
  })
}

export function saveOrUpdateDict(data) {
  return request({
    url: APIS.V1+`/system/account/dict`,
    method: 'put',
    data
  })
}

export function deleteDict(params) {
  return request({
    url: APIS.V1+`/system/account/dict`,
    method: 'delete',
    params:params
  })
}
// 根据字典类型名称查询
export function findByDictTypeName(dictTypeName) {
  return request({
    url: APIS.V1+`/system/account/dict/findByDictTypeName?dictTypeName=`+dictTypeName,
    method: 'get'
  })
}
